//
//  RecevieListCell.m
//  BestLearning
//
//  Created by 星道 on 17/9/18.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "RecevieListCell.h"
#import "RecevieListModel.h"

@implementation RecevieListCell
{
    IBOutlet UILabel *_title;
    IBOutlet UIButton *_num;
}


- (void)setModel:(RecevieListModel *)model {

    _model = model;


    _title.text = [NSString stringWithFormat:@"%ld. %@",model.num,model.Description];

    NSString *str = model.isFlower ? [NSString stringWithFormat:@"+%ld%@",[model.amount integerValue],@"朵"]:[NSString stringWithFormat:@"+%.2f%@",[model.amount doubleValue],@"星币"];
    if ([model.amount isEqualToNumber:@0]) {

        _num.selected = NO;
        [_num setTitle:str forState:(UIControlStateNormal)];

    } else {

        _num.selected = YES;
        [_num setTitle:str forState:(UIControlStateSelected)];
    }
}
@end
